﻿using System;
using System.Collections.Generic;
using System.Linq;
using System.Web;
using System.Web.UI;
using System.Web.UI.WebControls;
using System.Text;
using Newtonsoft.Json;

public partial class _Default : Basic
{
    public string strIdx00 = "";  //天气预报
    public string strIdx01 = "";  //
    public string strIdx02 = "";  //
    public string strIdx03 = "";  //
    public string strIdx04 = "";  //
    public string strIdx1_2 = "";  //股市播报
    public string strIdx1_3 = "";  //热门板块
    public string strIdx1_4 = "";  //新股备忘
    public string strIdx1_5 = "";  //操盘必备
    public string strIdx1_6 = "";  //益盟视点
    public string strIdx1_7 = "";  //买卖提示
    public string strIdx1_8 = "";  //买卖提示    
    public string strIdx2_1 = "";  //股市直播
    public string strIdx2_2 = "";  //涨跌板块
    public string strIdx2_3 = "";  //涨跌板块
    public string strIdx2_4 = "";  //名师解盘
    public string strIdx2_5 = "";  //股票医生评分榜
    public string strIdx2_6 = "";  //每日一股
    public string strIdx2_7 = "";  //资料下载
    public string strIdx3_1 = "";  //市场研究
    public string strIdx3_2 = "";  //最新研报
    public string strIdx3_3 = "";  //机构股票池/业绩预测 
    public string strIdx3_4 = "";  //市场焦点()
    public string strIdx3_5 = "";  //市场焦点列表()
    public string strIdx4_1 = "";  //投资理财
    public string strIdx4_2 = "";  //投资理财
    public string strIdx4_3 = "";  //论坛精华
    public string strIdx5_3 = "";  //益盟动态
    public string strIdx6_1 = "";  //友情链接
    public string strIdx0_1 = "";  //热门板块股票

    protected void Page_Load(object sender, EventArgs e)
    {
        strIdx6_1 = sb友情链接().ToString();

        strIdx01 = sbIdx01().ToString();
        strIdx02 = sbIdx02().ToString();
        strIdx03 = sbIdx03().ToString();
        strIdx04 = sbIdx04().ToString();

        strIdx0_1 = sb热门板块股票().ToString();

        strIdx1_2 = sb股市播报().ToString();

        strIdx2_1 = sb股市直播01().ToString();

        strIdx3_1 = sb市场研究01().ToString();

        strIdx3_2 = sb市场研究02().ToString();

        strIdx4_1 = sb投资理财01().ToString();

        strIdx4_2 = sb投资理财02().ToString();

        strIdx4_3 = sb投资理财03().ToString();

        strIdx5_3 = sb股市入门().ToString();

        strIdx1_3 = sb热门板块().ToString();

        strIdx1_4 = sb新股备忘().ToString();

        strIdx2_2 = sb涨跌板块().ToString();

        strIdx2_3 = sb主力数据().ToString();

        strIdx3_3 = sb市场研究03().ToString();

        strIdx1_5 = sb操盘必备().ToString();

        strIdx2_4 = sb名师解盘().ToString();

        strIdx1_6 = sb益盟视点().ToString();

        strIdx1_7 = sb买卖提示().ToString();

        strIdx1_8 = sb视频().ToString();

        strIdx00 = sb天气预报().ToString();

        strIdx2_5 = sb股票医生评分榜().ToString();

        strIdx2_6 = sb每日一股().ToString();

        strIdx2_7 = sb资料下载().ToString();

        strIdx3_4 = sb市场焦点().ToString();

        strIdx3_5 = sb市场焦点列表().ToString();


    }

    /// <summary>
    /// 首页第一片手编
    /// </summary>
    /// <returns></returns>
    protected StringBuilder sbIdx01()
    {
        StringBuilder sb = new StringBuilder();
        //try
        //{
        string url = jsonUrl + "comm/module.ashx?id=zsj";
        string str = Pub.LoadData(url);
        List<List<NewsSBEnty>> obj = JsonConvert.DeserializeObject<List<List<NewsSBEnty>>>(str);
        for (int i = 0; i < obj.Count; i++)
        {
            switch (i)
            {
                case 0:
                case 4:
                    {
                        if (obj[i].Count == 1)
                            sb.AppendFormat("<li class=\"h2 red marginTop5\"><a href=\"{1}\" class=\"r\">{0}</li></a>", obj[i][0].Text, obj[i][0].Url);
                        break;
                    }
                case 1:
                case 2:
                case 3:
                    {
                        sb.Append("<li class=\"font12\">");
                        for (int j = 0; j < obj[i].Count; j++)
                        {
                            if (j == 0)
                                sb.AppendFormat("<span class=\"red\">{0}</span> ", obj[i][j].Text);
                            else
                                sb.AppendFormat("<a href=\"{1}\" style=\"{2}{3}\">[{0}]</a>", obj[i][j].Text, obj[i][j].Url, string.IsNullOrEmpty(obj[i][j].Color) ? "" : "color:" + obj[i][j].Color + ";", string.IsNullOrEmpty(obj[i][j].FontWeight) ? "" : "font-weight:" + obj[i][j].FontWeight + ";");
                        }
                        sb.Append("</li>");
                        break;
                    }
                case 5:
                    {
                        sb.Append("<li class=\"font12\">");
                        for (int j = 0; j < obj[i].Count; j++)
                        {
                            sb.AppendFormat("<a href=\"{1}\" style=\"{2}{3}\">[{0}]</a>", obj[i][j].Text, obj[i][j].Url, string.IsNullOrEmpty(obj[i][j].Color) ? "" : "color:" + obj[i][j].Color + ";", string.IsNullOrEmpty(obj[i][j].FontWeight) ? "" : "font-weight:" + obj[i][j].FontWeight + ";");
                        }
                        sb.Append("</li>");
                        break;
                    }
            }
        }
        //}
        //catch
        //{ }
        return sb;
    }
    /// <summary>
    /// 首页第一片 要闻 信息
    /// </summary>
    /// <returns></returns>
    protected StringBuilder sbIdx02()
    {
        StringBuilder sb = new StringBuilder();
        //try
        //{
        string url = jsonUrl + "/comm/module.ashx?id=z12";
        string str = Pub.LoadData(url);
        List<List<NewsSBEnty>> obj = JsonConvert.DeserializeObject<List<List<NewsSBEnty>>>(str);

        int len = 6;
        if (obj.Count < 6)
            len = obj.Count;
        for (int i = 0; i < len; i++)
        {
            int len2 = 3;
            if (obj[i].Count < 3)
                len2 = obj[i].Count;
            sb.Append("<li>·");
            for (int j = 0; j < len2; j++)
            {
                if (i == 0 && j == 0)
                    sb.AppendFormat("<a href=\"{1}\" class=\"h3\">{0}</a>&nbsp;|&nbsp;", obj[i][j].Text, obj[i][j].Url);
                else
                    sb.AppendFormat("<a href=\"{1}\" title=\"{0}\"style=\"{2}{3}\">{0}</a>&nbsp;", obj[i][j].Text, obj[i][j].Url, string.IsNullOrEmpty(obj[i][j].Color) ? "" : "color:" + obj[i][j].Color + ";", string.IsNullOrEmpty(obj[i][j].FontWeight) ? "" : "font-weight:" + obj[i][j].FontWeight + ";");
            }
            sb.Append("</li>");
        }
        //}
        //catch
        //{ }
        return sb;
    }
    /// <summary>
    /// 首页第一片 公司 信息
    /// </summary>
    /// <returns></returns>
    protected StringBuilder sbIdx03()
    {
        StringBuilder sb = new StringBuilder();
        //try
        //{
        string url = jsonUrl + "/comm/module.ashx?id=z13";
        string str = Pub.LoadData(url);
        List<List<NewsSBEnty>> obj = JsonConvert.DeserializeObject<List<List<NewsSBEnty>>>(str);

        int len = 6;
        if (obj.Count < 6)
            len = obj.Count;
        for (int i = 0; i < len; i++)
        {
            int len2 = 3;
            if (obj[i].Count < 3)
                len2 = obj[i].Count;
            sb.Append("<li>·");
            for (int j = 0; j < len2; j++)
            {
                if (i == 0 && j == 0)
                    sb.AppendFormat("<a href=\"{1}\" class=\"h3\">{0}</a>&nbsp;|&nbsp;", obj[i][j].Text, obj[i][j].Url);
                else
                    sb.AppendFormat("<a href=\"{1}\" style=\"{2}{3}\">{0}</a>&nbsp;", obj[i][j].Text, obj[i][j].Url, string.IsNullOrEmpty(obj[i][j].Color) ? "" : "color:" + obj[i][j].Color + ";", string.IsNullOrEmpty(obj[i][j].FontWeight) ? "" : "font-weight:" + obj[i][j].FontWeight + ";");
            }
            sb.Append("</li>");
        }
        //}
        //catch
        //{ }
        return sb;
    }
    /// <summary>
    /// 首页第一片  新股、主力、金融
    /// </summary>
    /// <returns></returns>
    protected StringBuilder sbIdx04()
    {
        StringBuilder sb = new StringBuilder();
        //try
        //{
        string url = jsonUrl + "/comm/module.ashx?id=z14";
        string str = Pub.LoadData(url);
        List<List<NewsSBEnty>> obj = JsonConvert.DeserializeObject<List<List<NewsSBEnty>>>(str);

        int len = 4;
        if (obj.Count < len)
            len = obj.Count;
        for (int i = 0; i < len; i++)
        {
            int len2 = 3;
            if (obj[i].Count < len2)
                len2 = obj[i].Count;
            sb.Append("<li>·");
            for (int j = 0; j < len2; j++)
            {
                if (j == 0)
                    sb.AppendFormat("<a href=\"{1}\" class=\"h3\">{0}</a>&nbsp;|&nbsp;", obj[i][j].Text, obj[i][j].Url);
                else
                    sb.AppendFormat("<a href=\"{1}\"style=\"{2}{3}\">{0}</a>&nbsp;", obj[i][j].Text, obj[i][j].Url, string.IsNullOrEmpty(obj[i][j].Color) ? "" : "color:" + obj[i][j].Color + ";", string.IsNullOrEmpty(obj[i][j].FontWeight) ? "" : "font-weight:" + obj[i][j].FontWeight + ";");
            }
            sb.Append("</li>");
        }
        //}
        //catch
        //{ }
        return sb;
    }
    /// <summary>
    /// __首页第一片 新股、主力、金融
    /// </summary>
    /// <returns></returns>
    protected StringBuilder tmpsbIdx03()
    {
        StringBuilder sb = new StringBuilder();
        //try
        //{
        string url = jsonUrl + "news/NewsListMany.ashx?typeid=0902,0105,0106&top=2";
        string str = Pub.LoadData(url);
        List<NewsList> list = JsonConvert.DeserializeObject<List<NewsList>>(str);
        if (list.Count > 0)
        {
            sb.Append("<li class=\"line\"></li>");
            foreach (var item in list)
            {
                if (item.list.Length > 0)
                {
                    sb.AppendFormat("<li> ·<a href=\"{1}\" class=\"h3\">{0}</a> |", item.typename.Contains("新股") ? "新股" : item.typename, GetNewListUrl("01", item.typeid, 1));
                    foreach (var m in item.list)
                    {
                        sb.AppendFormat(" <a href=\"{1}\">{0}</a>", m.Title, GetNewsUrl("01", item.typeid, m.Id));
                    }
                    sb.Append("</li>");
                }
            }
        }
        //}
        //catch
        //{ }
        return sb;
    }

    /// <summary>
    /// 左栏新闻
    /// </summary>
    /// <returns></returns>
    protected StringBuilder sb股市直播01()
    {
        StringBuilder sb = new StringBuilder();
        //try
        //{
        string url = jsonUrl + "news/NewsListMany.ashx?typeid=0303,0304,0305&top=13";
        string str = Pub.LoadData(url);
        List<NewsList> list = JsonConvert.DeserializeObject<List<NewsList>>(str);
        foreach (var item in list)
        {
            #region
            switch (item.typeid)
            {
                case "0303":
                    {
                        sb.Append("<div class=\"index_gszb2_m_1\">");
                        sb.Append("  <div class=\"index_content_h h3\">大 盘<span class=\"index_content_h_more\"><a href=\"" + GetNewListUrl("11", item.typeid, 1) + "\" class=\"b\">更多>></a></span></div>");
                        sb.Append("  <div class=\"index_gszb2_l_01\">");
                        sb.Append("    <dl>");

                        if (item.list.Length > 0)
                        {
                            sb.AppendFormat("<dt class=\"h2\"><a href=\"{1}\">{0}</a></dt>", item.list[0].Title, GetNewsUrl("11", item.typeid, item.list[0].Id));

                            int len = 13;
                            if (item.list.Length < len)
                                len = item.list.Length;
                            for (int i = 1; i < len; i++)
                            {
                                if ((i % 2) == 1)
                                    sb.AppendFormat("<dd> ·");
                                sb.AppendFormat("<a href=\"{1}\">{0}</a>&nbsp;&nbsp;", item.list[i].Title, GetNewsUrl("11", item.typeid, item.list[i].Id));
                                if ((i % 2) == 0 || i == len)
                                    sb.AppendFormat("</dd>");
                            }
                        }
                        sb.Append("    </dl>");
                        sb.Append("  </div>");
                        sb.Append("</div>");
                        break;
                    }
                case "0304":
                    {
                        sb.Append("<div class=\"index_gszb2_m_2\">");
                        sb.Append("  <div class=\"index_content_h h3\">板 块<span class=\"index_content_h_more\"><a href=\"" + GetNewListUrl("12", item.typeid, 1) + "\" class=\"b\">更多>></a></span></div>");
                        sb.Append("  <div class=\"index_gszb2_l_01\">");
                        sb.Append("    <dl>");

                        if (item.list.Length > 0)
                        {
                            sb.AppendFormat("<dt class=\"h2\"><a href=\"{1}\">{0}</a></dt>", item.list[0].Title, GetNewsUrl("12", item.typeid, item.list[0].Id));

                            int len = 13;
                            if (item.list.Length < len)
                                len = item.list.Length;
                            for (int i = 1; i < len; i++)
                            {
                                if ((i % 2) == 1)
                                    sb.AppendFormat("<dd> ·");
                                sb.AppendFormat("<a href=\"{1}\">{0}</a>&nbsp;&nbsp;", item.list[i].Title, GetNewsUrl("12", item.typeid, item.list[i].Id));
                                if ((i % 2) == 0 || i == len)
                                    sb.AppendFormat("</dd>");
                            }
                        }
                        sb.Append("    </dl>");
                        sb.Append("  </div>");
                        sb.Append("</div>");
                        break;
                    }
                case "0305":
                    {
                        sb.Append("<div class=\"index_gszb2_m_2\">");
                        sb.Append("  <div class=\"index_content_h h3\">个 股<span class=\"index_content_h_more\"><a href=\"" + GetNewListUrl("13", item.typeid, 1) + "\" class=\"b\">更多>></a></span></div>");
                        sb.Append("  <div class=\"index_gszb2_l_01\">");
                        sb.Append("    <dl>");

                        if (item.list.Length > 0)
                        {
                            sb.AppendFormat("<dt class=\"h2\"><a href=\"{1}\">{0}</a></dt>", item.list[0].Title, GetNewsUrl("13", item.typeid, item.list[0].Id));

                            int len = 13;
                            if (item.list.Length < len)
                                len = item.list.Length;
                            for (int i = 1; i < len; i++)
                            {
                                if ((i % 2) == 1)
                                    sb.AppendFormat("<dd> ·");
                                sb.AppendFormat("<a href=\"{1}\">{0}</a>&nbsp;&nbsp;", item.list[i].Title, GetNewsUrl("13", item.typeid, item.list[i].Id));
                                if ((i % 2) == 0 || i == len)
                                    sb.AppendFormat("</dd>");
                            }
                        }
                        sb.Append("    </dl>");
                        sb.Append("  </div>");
                        sb.Append("</div>");
                        break;
                    }
            }
            #endregion
        }
        //}
        //catch
        //{ }
        return sb;
    }

    /// <summary>
    /// 股市播报
    /// </summary>
    /// <returns></returns>
    protected StringBuilder sb股市播报()
    {
        StringBuilder sb = new StringBuilder();
        string str = Pub.LoadData(jsonUrl + "news/NewsListMany.ashx?typeid=0112&top=5");
        List<NewsList> obj = JsonConvert.DeserializeObject<List<NewsList>>(str);
        if (obj.Count > 0)
        {
            int i = 0;
            foreach (var m in obj[0].list)
            {
                if (i == 0)
                {
                    NewsContentEnty obj2 = JsonConvert.DeserializeObject<NewsContentEnty>(Pub.LoadData(jsonUrl + "/news/UNews.ashx?id=" + m.Id));
                    if (obj2 != null)
                    {
                        sb.AppendFormat("<li class=\"h2\"><a href=\"{1}\">{0}</a></li>", obj2.Title, GetNewsUrl("01", "0112", m.Id));
                        sb.AppendFormat("<li class=\"font12 gray\">{0}<a href=\"{1}\" class=\"r\">[详细]</a></li>", OTO.CutStr(obj2.Summary, 40), GetNewsUrl("01", "0112", m.Id));
                        sb.Append("<li class=\"line\" style=\"height:10px\"></li>");
                    }
                }
                else
                {
                    sb.AppendFormat("<li> ·<a href=\"{1}\" class=\"b\">{0}</a></li>", m.Title, GetNewsUrl("01", "0112", m.Id));
                }
                i++;
            }
        }

        return sb;
    }

    /// <summary>
    /// 晨报精选 投资策略
    /// </summary>
    /// <returns></returns>
    protected StringBuilder sb市场研究01()
    {
        StringBuilder sb = new StringBuilder();
        //try
        //{
        string url = jsonUrl + "news/NewsListMany.ashx?typeid=0301,0302&top=15";
        string str = Pub.LoadData(url);
        List<NewsList> list = JsonConvert.DeserializeObject<List<NewsList>>(str);
        foreach (var item in list)
        {
            #region
            switch (item.typeid)
            {
                case "0301":
                    {
                        sb.Append("<div class=\"index_gsyj2_l_a\">");
                        sb.AppendLine("    <div class=\"index_content_h h3\">晨报精选<span class=\"index_content_h_more\"><a href=\"" + GetNewListUrl("04", item.typeid, 1) + "\" class=\"b\">更多>></a></span></div>");
                        sb.Append("    <div class=\"index_gszb2_l_02\">");
                        sb.Append("      <dl>");

                        NewsHeadEnty obj2 = JsonConvert.DeserializeObject<NewsHeadEnty>(Pub.LoadData(jsonUrl + "news/Headline.ashx?id=cbjx"));
                        if (obj2 != null)
                        {
                            sb.AppendFormat("<dt class=\"h2\"><a href=\"{1}\">{0}</a>", obj2.Title, obj2.Url);
                            sb.AppendFormat("<p>{0}<a href=\"{1}\" class=\"r\">[详细]</a></p></dt>", OTO.CutStr(obj2.Content, 50), obj2.Url);
                        }

                        int len = 15;
                        if (item.list.Length < len)
                            len = item.list.Length;
                        for (int i = 1; i < len; i++)
                        {
                            if ((i % 2) == 1)
                                sb.AppendFormat("<dd> ·");

                            sb.AppendFormat("<a href=\"{1}\" title=\"{0}\">{0}</a> ", item.list[i].Title, GetNewsUrl("04", item.typeid, item.list[i].Id));

                            if ((i % 2) == 0 || i == len)
                                sb.AppendFormat("</dd>");
                        }

                        sb.Append("      </dl>");
                        sb.Append("    </div>");
                        sb.Append("</div>");
                        break;
                    }
                case "0302":
                    {
                        sb.Append("<div class=\"index_gsyj2_m_1_3\">");
                        sb.Append("  <div class=\"index_content_h h3\">投资策略<span class=\"index_content_h_more\"><a href=\"" + GetNewListUrl("04", item.typeid, 1) + "\" class=\"b\">更多>></a></span></div>");
                        sb.Append("  <div class=\"index_gszb2_l_01\">");
                        sb.Append("    <dl>");
                        if (item.list.Length > 0)
                        {
                            sb.AppendFormat("<dt class=\"h2\"><a href=\"{1}\">{0}</a></dt>", item.list[0].Title, GetNewsUrl("04", item.typeid, item.list[0].Id));

                            int len = 13;
                            if (item.list.Length < len)
                                len = item.list.Length;
                            for (int i = 1; i < len; i++)
                            {
                                if ((i % 2) == 1)
                                    sb.AppendFormat("<dd> ·");
                                sb.AppendFormat("<a href=\"{1}\" title=\"{0}\">{0}</a>&nbsp;&nbsp;", item.list[i].Title, GetNewsUrl("04", item.typeid, item.list[i].Id));
                                if ((i % 2) == 0 || i == len)
                                    sb.AppendFormat("</dd>");
                            }
                        }
                        sb.Append("    </dl>");
                        sb.Append("  </div>");
                        sb.Append("</div>");
                        break;
                    }
            }
            #endregion
        }
        //}
        //catch
        //{ }
        return sb;
    }

    /// <summary>
    /// 最新研报
    /// </summary>
    /// <returns></returns>
    protected StringBuilder sb市场研究02()
    {
        StringBuilder sb = new StringBuilder();
        //try
        //{
        string url = jsonUrl + "news/NewsListMany.ashx?typeid=0309&top=6";
        string str = Pub.LoadData(url);
        List<NewsList> list = JsonConvert.DeserializeObject<List<NewsList>>(str);
        foreach (var item in list)
        {
            sb.Append("<dl>");
            if (item.list.Length > 0)
            {
                sb.AppendFormat("<dt class=\"h2\"><a href=\"{1}\">{0}</a></dt>", item.list[0].Title, GetNewsUrl("04", item.typeid, item.list[0].Id));

                int len = 6;
                if (item.list.Length < len)
                    len = item.list.Length;
                for (int i = 1; i < len; i++)
                {
                    sb.AppendFormat("<dd> ·<a href=\"{1}\" title=\"{0}\" class=\"b\">{0}</a></dd>", item.list[i].Title, GetNewsUrl("04", item.typeid, item.list[i].Id));
                }
            }
            sb.Append("</dl>");
        }
        //}
        //catch
        //{ }
        return sb;
    }
    /// <summary>
    /// 机构股票池/业绩预测 
    /// </summary>
    /// <returns></returns>
    protected StringBuilder sb市场研究03()
    {
        StringBuilder sb = new StringBuilder();
        //try
        //{
        string url = jsonUrl + "stock/StockPool_summary.ashx?top=8";
        string str = Pub.LoadData(url);
        JHWJ obj = JsonConvert.DeserializeObject<JHWJ>(str);

        url = jsonUrl + "stock/StockPool_GetOne.ashx?flag=yjyc&skip=0&top=8";
        str = Pub.LoadData(url);
        NewStock_BData_C obj2 = JsonConvert.DeserializeObject<NewStock_BData_C>(str);


        sb.Append("<div class=\"index_gsyj2_r\">");
        sb.Append("<div class=\"index_content_m_2_nav\">");
        sb.Append("<ul id=\"tbPool\">");
        sb.Append("<li a4=\"1\" class=\"index_content_m_1_1 index_content_m_1_on\">机构股票池</li>");
        sb.Append("<li a4=\"2\" class=\"index_content_m_1_1\">业绩预测</li>");
        sb.Append("<span class=\"index_content_h_more\"><a href=\"" + wwwUrl + "report_yjyc.shtml\" class=\"b\">更多>></a></span>");
        sb.Append("</ul>");
        sb.Append("</div>");
        sb.Append("<div class=\"index_gszb2_l_1\">");

        #region
        sb.Append("<div id=\"tbPool_1\">");
        sb.Append("<table width=\"100%\" border=\"0\" align=\"center\" cellpadding=\"0\" cellspacing=\"1\">");
        sb.Append("<tr align=\"center\">");
        sb.Append("<td height=\"22\">证券简称</td>");
        sb.Append("<td>最新评阶</td>");
        sb.Append("<td>报告</td>");
        sb.Append("</tr>");
        int i = 0;
        foreach (var m in obj.机构股票池.list)
        {
            i++;
            string _class = "class=\"bgGray\"";
            if (i % 2 == 0)
                _class = "";
            sb.AppendFormat("<tr align=\"center\" {0}>", _class);
            sb.AppendFormat("<td height=\"22\" ><a href=\"{2}gg{1}.shtml\">{0}</a></td>", m.StockName, m.StockId, quoteUrl);
            sb.AppendFormat("<td>{0}</td>", m.InvestmentGrade);
            sb.AppendFormat("<td><a href=\"{1}reportContent_{0}.shtml\">摘要</a></td>", m.id, NewsUrl);
            sb.Append("</tr>");
        }
        sb.Append("</table>");
        sb.Append("</div>");
        #endregion

        #region
        sb.Append("<div id=\"tbPool_2\" class=\"hide\">");
        sb.Append("<table width=\"100%\" border=\"0\" align=\"center\" cellpadding=\"0\" cellspacing=\"1\">");
        sb.Append("<tr align=\"center\">");
        sb.Append("<td height=\"22\">证券简称</td>");
        sb.Append("<td>目标价</td>");
        sb.Append("<td>报告日期</td>");
        sb.Append("</tr>");
        i = 0;
        if (obj2.list != null && obj2.list.Count>0)
        {
        foreach (var m in obj2.list)
        {
            i++;
            string _class = "class=\"bgGray\"";
            if (i % 2 == 0)
                _class = "";
            sb.AppendFormat("<tr align=\"center\" {0}>", _class);
            sb.AppendFormat("<td height=\"22\" ><a href=\"{2}gg{1}.shtml\">{0}</a></td>", m.StockName, m.StockId, quoteUrl);
            sb.AppendFormat("<td>{0}</td>", OTO.CoUt(m.TargetPrice, 1, "-", 2));
            sb.AppendFormat("<td><a href=\"{1}reportContent_{0}.shtml\">摘要</a></td>", m.id, NewsUrl);
            sb.Append("</tr>");
        }
            }
        sb.Append("</table>");
        sb.Append("</div>");
        #endregion

        sb.Append("</div>");
        sb.Append("<div class=\"index_content_m_2_nav up_line\">");
        sb.Append("<ul id=\"tbjg\">");
        sb.Append("<li a5=\"1\" class=\"index_content_m_1_1 index_content_m_1_on\">机构首次关注</li>");
        sb.Append("<li a5=\"2\" class=\"index_content_m_1_1\">机构关注度最高</li>");
        sb.Append("<span class=\"index_content_h_more\"><a href=\"" + wwwUrl + "report_yjyc.shtml\" class=\"b\">更多>></a></span>");
        sb.Append("</ul>");
        sb.Append("</div>");
        sb.Append("<div class=\"index_gszb2_l_1\">");

        #region
        sb.Append("<div id=\"tbjg_1\">");
        sb.Append("<table width=\"100%\" border=\"0\" align=\"center\" cellpadding=\"0\" cellspacing=\"1\">");
        sb.Append("<tr align=\"center\">");
        sb.Append("<td height=\"22\">证券简称</td>");
        sb.Append("<td>最新评阶</td>");
        sb.Append("<td>报告</td>");
        sb.Append("</tr>");
        i = 0;
        foreach (var m in obj.机构首次关注股票.list)
        {
            i++;
            string _class = "class=\"bgGray\"";
            if (i % 2 == 0)
                _class = "";
            sb.AppendFormat("<tr align=\"center\" {0}>", _class);
            sb.AppendFormat("<td height=\"22\" ><a href=\"{2}gg{1}.shtml\">{0}</a></td>", m.StockName, m.StockId, quoteUrl);
            sb.AppendFormat("<td>{0}</td>", m.InvestmentGrade);
            sb.AppendFormat("<td><a href=\"{1}reportContent_{0}.shtml\">摘要</a></td>", m.id, NewsUrl);
            sb.Append("</tr>");
        }
        sb.Append("</table>");
        sb.Append("</div>");
        #endregion

        #region
        sb.Append("<div id=\"tbjg_2\" class=\"hide\">");
        sb.Append("<table width=\"100%\" border=\"0\" align=\"center\" cellpadding=\"0\" cellspacing=\"1\">");
        sb.Append("<tr align=\"center\">");
        sb.Append("<td height=\"22\">证券简称</td>");
        sb.Append("<td>报告</td>");
        sb.Append("<td>报告日期</td>");
        sb.Append("</tr>");
        i = 0;
        foreach (var m in obj.机构关注度最高.list)
        {
            i++;
            string _class = "class=\"bgGray\"";
            if (i % 2 == 0)
                _class = "";
            sb.AppendFormat("<tr align=\"center\" {0}>", _class);
            sb.AppendFormat("<td height=\"22\" ><a href=\"{2}gg{1}.shtml\">{0}</a></td>", m.StockName, m.StockId, quoteUrl);
            sb.AppendFormat("<td>{0}</td>", m.InvestmentGrade);
            sb.AppendFormat("<td><a href=\"{1}reportContent_{0}.shtml\">摘要</a></td>", m.id, NewsUrl);
            sb.Append("</tr>");
        }
        sb.Append("</table>");
        sb.Append("</div>");
        #endregion

        sb.Append("</div>");
        sb.Append("</div>");

        //}
        //catch
        //{ }
        return sb;
    }


    /// <summary>
    /// 炒股技巧 理财技巧
    /// </summary>
    /// <returns></returns>
    protected StringBuilder sb投资理财01()
    {
        StringBuilder sb = new StringBuilder();
        //try
        //{
        string url = jsonUrl + "news/NewsListMany.ashx?typeid=0201,0202&top=15";
        string str = Pub.LoadData(url);
        List<NewsList> list = JsonConvert.DeserializeObject<List<NewsList>>(str);
        foreach (var item in list)
        {
            #region
            switch (item.typeid)
            {
                case "0201":
                    {
                        sb.Append("<div class=\"index_tzlc2_l_a\">");
                        sb.AppendLine("    <div class=\"index_content_h h3\">炒股技巧<span class=\"index_content_h_more\"><a href=\"" + GetNewListUrl("04", item.typeid, 1) + "\" class=\"b\">更多>></a></span></div>");
                        sb.Append("    <div class=\"index_gszb2_l_01\">");
                        sb.Append("<dl>");
                        if (item.list.Length > 0)
                        {
                            sb.AppendFormat("<dt class=\"h2\"><a href=\"{1}\">{0}</a></dt>", item.list[0].Title, GetNewsUrl("04", item.typeid, item.list[0].Id));

                            int len = 15;
                            if (item.list.Length < len)
                                len = item.list.Length;
                            for (int i = 1; i < len; i++)
                            {
                                if ((i % 2) == 1)
                                    sb.AppendFormat("<dd> ·");
                                sb.AppendFormat("<a href=\"{1}\" title=\"{0}\">{0}</a>&nbsp;&nbsp;", item.list[i].Title, GetNewsUrl("04", item.typeid, item.list[i].Id));
                                if ((i % 2) == 0)
                                    sb.AppendFormat("</dd>");
                            }
                        }
                        sb.Append("</dl>");
                        sb.Append("    </div>");
                        sb.Append("</div>");
                        break;
                    }
                case "0202":
                    {
                        sb.Append("<div class=\"index_gsyj2_m_1_3\">");
                        sb.Append("  <div class=\"index_content_h h3\">理财技巧<span class=\"index_content_h_more\"><a href=\"" + GetNewListUrl("04", item.typeid, 1) + "\" class=\"b\">更多>></a></span></div>");
                        sb.Append("  <div class=\"index_gszb2_l_01\">");
                        sb.Append("<dl>");
                        if (item.list.Length > 0)
                        {
                            sb.AppendFormat("<dt class=\"h2\"><a href=\"{1}\">{0}</a></dt>", item.list[0].Title, GetNewsUrl("04", item.typeid, item.list[0].Id));

                            int len = 13;
                            if (item.list.Length < len)
                                len = item.list.Length;
                            for (int i = 1; i < len; i++)
                            {
                                if ((i % 2) == 1)
                                    sb.AppendFormat("<dd> ·");
                                sb.AppendFormat("<a href=\"{1}\" title=\"{0}\">{0}</a>&nbsp;&nbsp;", item.list[i].Title, GetNewsUrl("04", item.typeid, item.list[i].Id));
                                if ((i % 2) == 0)
                                    sb.AppendFormat("</dd>");
                            }
                        }
                        sb.Append("</dl>");
                        sb.Append("  </div>");
                        sb.Append("</div>");
                        break;
                    }
            }
            #endregion
        }
        //}
        //catch
        //{ }
        return sb;
    }


    /// <summary>
    /// 股市入门8 学习资料下载6
    /// </summary>
    /// <returns></returns>
    protected StringBuilder sb投资理财02()
    {
        StringBuilder sb = new StringBuilder();
        //try
        //{
        string url = jsonUrl + "news/NewsListMany.ashx?typeid=0204&top=10";
        string str = Pub.LoadData(url);
        List<NewsList> list = JsonConvert.DeserializeObject<List<NewsList>>(str);
        foreach (var item in list)
        {
            #region
            switch (item.typeid)
            {
                case "0204":
                    {
                        sb.Append("<div class=\"index_tzlc2_l_a\">");
                        sb.AppendLine("    <div class=\"index_content_h h3 blue\"><img src=\"http://down3.emstock.com.cn/www/images/index_ico2.gif\" class=\"img\" />股市入门<span class=\"index_content_h_more\"><a href=\"" + GetNewListUrl("04", item.typeid, 1) + "\" class=\"b\">更多>></a></span></div>");
                        sb.Append("    <div class=\"index_gszb2_l_01\">");
                        sb.Append("      <dl>");

                        int len = 10;
                        if (item.list.Length < len)
                            len = item.list.Length;
                        for (int i = 0; i < len; i++)
                        {
                            sb.AppendFormat("<dd> ·<a href=\"{1}\" class=\"b\">{0}</a></dd> ", item.list[i].Title, GetNewsUrl("04", item.typeid, item.list[i].Id));
                        }

                        sb.Append("      </dl>");
                        sb.Append("    </div>");
                        sb.Append("</div>");
                        break;
                    }
            }
            #endregion
        }
        //}
        //catch
        //{ }
        return sb;
    }


    /// <summary>
    /// 论坛精华
    /// </summary>
    /// <returns></returns>
    protected StringBuilder sb投资理财03()
    {
        StringBuilder sb = new StringBuilder();
        //try
        //{
        string url = jsonUrl + "news/ltjh.ashx";
        string str = Pub.LoadData(url);
        List<NewsListEnty> list = JsonConvert.DeserializeObject<List<NewsListEnty>>(str);
        int len = 10;
        if (list.Count < len)
            len = list.Count;
        sb.Append("<ul>");
        for (int i = 0; i < len; i++)
        {
            sb.AppendFormat("<li> ·<a href=\"{1}\" class=\"b\">{0}</a> </li>", list[i].Title, list[i].Url);
        }
        sb.Append("</ul>");
        //}
        //catch
        //{ }
        return sb;
    }


    /// <summary>
    /// 益盟动态0401
    /// </summary>
    /// <returns></returns>
    protected StringBuilder sb股市入门()
    {
        StringBuilder sb = new StringBuilder();
        //try
        //{
        string url = jsonUrl + "news/NewsListMany.ashx?typeid=0401&top=6";
        string str = Pub.LoadData(url);
        List<NewsList> list = JsonConvert.DeserializeObject<List<NewsList>>(str);
        foreach (var item in list)
        {
            sb.Append("<ul>");
            for (int i = 0; i < item.list.Length; i++)
            {
                sb.AppendFormat("<li> ·<a href=\"{3}Introduce/NewsContent_{1}_{2}.shtml\">{0}</a> </li>", item.list[i].Title, item.list[i].Id, item.typeid, wwwUrl);
            }
            sb.Append("</ul>");
        }
        //}
        //catch
        //{ }
        return sb;
    }

    protected StringBuilder sb热门板块()
    {
        StringBuilder sb = new StringBuilder();
        //try
        //{
        string url = jsonUrl + "comm/JQGZGP.ashx";
        string str = Pub.LoadData(url);
        List<Gzbk> list = JsonConvert.DeserializeObject<List<Gzbk>>(str);
        if (list.Count > 0)
        {
            if (list[0].News != null)
            {
                sb.AppendFormat("<li class=\"h2\"><a href=\"{1}\" class=\"r\">{0}</a></li>", list[0].BKName, GetNewsUrl("04", "0", list[0].News.Id));
                sb.AppendFormat("<li class=\"font12 gray\">{0}<a href=\"{1}\" class=\"r\">[详细]</a></li>", OTO.CutStr(list[0].News.Content, 35), GetNewsUrl("03", "0", list[0].News.Id));
            }
            sb.AppendFormat("<li class=\"font12 gray\">可适当关注股票：</li>");

            sb.AppendFormat("<li>");
            int i = 0;
            foreach (var m in list[0].Stocks)
            {
                if (i < 4)
                    sb.AppendFormat("<a href=\"{2}gg{0}.shtml\" class=\"b\">{1}</a>（{0}）", m.Code, m.Name, quoteUrl);
                if (i == 1)
                    sb.AppendFormat("<br />");
                i++;
            }
            sb.AppendFormat("</li>");
        }
        //}
        //catch
        //{ }
        return sb;
    }

    protected StringBuilder sb新股备忘()
    {
        StringBuilder sb = new StringBuilder();
        //try
        //{
        string url = jsonUrl + "stock/NewStockList.ashx?skip=0&top=100";
        List<NewStock> list = JsonConvert.DeserializeObject<List<NewStock>>(Pub.LoadData(url));
        if (list != null)
            list = list.Where(x => x.fxrq.Value < DateTime.Now.AddDays(1)).OrderByDescending(o => o.fxrq).ToList();

        int n = 0;
        n = list.Where(x => x.fxrq.Value.ToString("yyyy-MM-dd").Equals(DateTime.Now.ToString("yyyy-MM-dd"))).Count();

        sb.Append("<ul>");
        sb.AppendFormat("<li class=\"center\" style=\"line-height:25px;\">今日有<span class=\"red\">{0}</span>只新股可申购，查看<a href=\"" + wwwUrl + "newStock.htm\" class=\"b\">新股一览</a></li>", n);
        sb.Append("<li>");
        sb.Append("<div class=\"index_gszb2_l_1a\">");
        sb.Append("<table width=\"100%\" border=\"0\" align=\"center\" cellpadding=\"0\" cellspacing=\"1\">");
        sb.Append("<tr>");
        sb.Append("<td height=\"22\" align=\"center\">股票名称</td>");
        sb.Append("<td align=\"center\">发行价</td>");
        sb.Append("<td align=\"center\">申购日期</td>");
        sb.Append("<td align=\"center\">上市日期</td>");
        sb.Append("</tr>");
        int len = 6;
        if (list.Count < 6)
            len = list.Count;
        for (int i = 0; i < len; i++)
        {
            string _class = "";
            if (i % 2 == 0)
                _class = "class=\"bgGray\"";
            sb.AppendFormat("<tr align=\"center\" {0}>", _class);
            sb.AppendFormat("<td height=\"22\" ><a href=\"{1}gg{2}.shtml\"><span class=\"{3}\">{0}</span></a></td>", list[i].gpjc, quoteUrl, list[i].gpdm, OTO.ToDate(list[i].fxrq, DateTime.Now.AddYears(-1)).ToString("yyyy-MM-dd") == DateTime.Now.ToString("yyyy-MM-dd") ? "red" : "");
            sb.AppendFormat("<td >{0}</td>", OTO.ToDecLine(list[i].fxjg, 2, "-"));
            sb.AppendFormat("<td >{0}</td>", OTO.ToDateLine(list[i].fxrq, 1));
            sb.AppendFormat("<td >{0}</td>", OTO.ToDateLine(list[i].ssrq, 1));
            sb.Append("</tr>");
        }
        sb.Append("</table>");
        sb.Append("</div>");
        sb.Append("</li>");
        sb.Append("</ul>");
        //}
        //catch
        //{ }
        return sb;
    }

    protected StringBuilder sb涨跌板块()
    {
        StringBuilder sb = new StringBuilder();
        //try
        //{
        string url = jsonUrl + "hangqing/bkph.ashx?count=100";
        BkphEnty obj = JsonConvert.DeserializeObject<BkphEnty>(Pub.LoadData(url));
        List<BkphItEnty> list = obj.行业板块;
        //涨
        #region
        List<BkphItEnty> list2 = list.Where(x => x.F > 0).ToList();
        sb.Append("<div id=\"tblzd_1\">");
        sb.Append("<table width=\"99%\" border=\"0\" cellpadding=\"0\" cellspacing=\"1\">");
        sb.Append("<tr align=\"center\">");
        sb.Append("<td height=\"22\">板块名称</td>");
        sb.Append("<td >涨跌幅</td>");
        sb.Append("<td >操盘线</td>");
        sb.Append("<td >领涨股</td>");
        sb.Append("</tr>");
        int len = 4;
        if (list2.Count < 4)
            len = list2.Count;
        for (int i = 0; i < len; i++)
        {
            string _class = "";
            if (i % 2 == 0)
                _class = "class=\"bgGray\"";
            sb.AppendFormat("<tr align=\"center\" {0}>", _class);
            sb.AppendFormat("<td height=\"22\"><a href=\"{2}Bk{1}.shtml\">{0}</a></td>", list2[i].BKName, list2[i].BKCode, quoteUrl);
            sb.AppendFormat("<td >{0}</td>", OTO.PerRedGre(list2[i].F, 1, "-", "%"));
            sb.AppendFormat("<td class=\"{1}\"> <span title=\"{2}\">{0}</span></td>", Math.Abs(list2[i].NC), list2[i].NC < 0 ? "bg_tipG" : "bg_tipR", Pub.NcTip(list2[i].NC));
            sb.AppendFormat("<td ><a href=\"{2}GG{1}.shtml\">{0}</a></td>", list2[i].LZName, list2[i].LZCode, quoteUrl);
            sb.Append("</tr>");
        }
        sb.Append("</table>");
        sb.Append("</div>");
        #endregion
        //跌
        #region
        list2 = list.Where(x => x.F < 0).OrderBy(x => x.F).ToList();
        sb.Append("<div class=\"hide\"  id=\"tblzd_2\">");
        sb.Append("<table width=\"99%\" border=\"0\" cellpadding=\"0\" cellspacing=\"1\">");
        sb.Append("<tr align=\"center\">");
        sb.Append("<td height=\"22\">板块名称</td>");
        sb.Append("<td >涨跌幅</td>");
        sb.Append("<td >操盘线</td>");
        sb.Append("<td >领涨股</td>");
        sb.Append("</tr>");
        len = 4;
        if (list2.Count < 4)
            len = list2.Count;
        for (int i = 0; i < len; i++)
        {
            string _class = "";
            if (i % 2 == 0)
                _class = "class=\"bgGray\"";
            sb.AppendFormat("<tr align=\"center\" {0}>", _class);
            sb.AppendFormat("<td height=\"22\"><a href=\"{2}Bk{1}.shtml\">{0}</a></td>", list2[i].BKName, list2[i].BKCode, quoteUrl);
            sb.AppendFormat("<td >{0}</td>", OTO.PerRedGre(list2[i].F, 1, "-", "%"));
            sb.AppendFormat("<td class=\"{1}\"> <span title=\"{2}\">{0}</span></td>", Math.Abs(list2[i].NC), list2[i].NC < 0 ? "bg_tipG" : "bg_tipR", Pub.NcTip(list2[i].NC));
            sb.AppendFormat("<td ><a href=\"{2}GG{1}.shtml\">{0}</a></td>", list2[i].LZName, list2[i].LZCode, quoteUrl);
            sb.Append("</tr>");
        }
        sb.Append("</table>");
        sb.Append("</div>");
        #endregion
        //}
        //catch
        //{
        //    sb = new StringBuilder();
        //}
        return sb;
    }

    protected StringBuilder sb主力数据()
    {
        StringBuilder sb = new StringBuilder();
        //try
        //{
        string url = jsonUrl + "hangqing/bkph.ashx?count=100";
        BkphEnty obj = JsonConvert.DeserializeObject<BkphEnty>(Pub.LoadData(url));
        List<BkphItEnty> list = obj.行业板块;
        //涨
        #region
        List<BkphItEnty> list2 = list.Where(x => x.J > 0).OrderByDescending(x => x.J).ToList();
        sb.Append("<div id=\"tbzl_1\">");
        sb.Append("<table width=\"99%\" border=\"0\" cellpadding=\"0\" cellspacing=\"1\">");
        sb.Append("<tr align=\"center\">");
        sb.Append("<td height=\"22\">板块名称</td>");
        sb.Append("<td >涨跌幅</td>");
        sb.Append("<td >主力净买</td>");
        sb.Append("<td >领涨股</td>");
        sb.Append("</tr>");
        int len = 4;
        if (list2.Count < 4)
            len = list2.Count;
        for (int i = 0; i < len; i++)
        {
            string _class = "";
            if (i % 2 == 0)
                _class = "class=\"bgGray\"";
            sb.AppendFormat("<tr align=\"center\" {0}>", _class);
            sb.AppendFormat("<td height=\"22\"><a href=\"{2}Bk{1}.shtml\">{0}</a></td>", list2[i].BKName, list2[i].BKCode, quoteUrl);
            sb.AppendFormat("<td >{0}</td>", OTO.PerRedGre(list2[i].F, 1, "-", "%"));
            sb.AppendFormat("<td >{0}</td>", OTO.PerRedGre(list2[i].J, 100000000, 2, "-", ""));
            sb.AppendFormat("<td ><a href=\"{2}GG{1}.shtml\">{0}</a></td>", list2[i].LZName, list2[i].LZCode, quoteUrl);
            sb.Append("</tr>");
        }
        sb.Append("</table>");
        sb.Append("</div>");
        #endregion
        //跌
        #region
        list2 = list.Where(x => x.J < 0).OrderBy(x => x.J).ToList();
        sb.Append("<div class=\"hide\"  id=\"tbzl_2\">");
        sb.Append("<table width=\"99%\" border=\"0\" cellpadding=\"0\" cellspacing=\"1\">");
        sb.Append("<tr align=\"center\">");
        sb.Append("<td height=\"22\">板块名称</td>");
        sb.Append("<td >涨跌幅</td>");
        sb.Append("<td >主力净卖</td>");
        sb.Append("<td >领涨股</td>");
        sb.Append("</tr>");
        len = 4;
        if (list2.Count < 4)
            len = list2.Count;
        for (int i = 0; i < len; i++)
        {
            string _class = "";
            if (i % 2 == 0)
                _class = "class=\"bgGray\"";
            sb.AppendFormat("<tr align=\"center\" {0}>", _class);
            sb.AppendFormat("<td height=\"22\"><a href=\"{2}Bk{1}.shtml\">{0}</a></td>", list2[i].BKName, list2[i].BKCode, quoteUrl);
            sb.AppendFormat("<td >{0}</td>", OTO.PerRedGre(list2[i].F, 1, "-", "%"));
            sb.AppendFormat("<td >{0}</td>", OTO.PerRedGre(list2[i].J, 100000000, 2, "-", ""));
            sb.AppendFormat("<td ><a href=\"{2}GG{1}.shtml\">{0}</a></td>", list2[i].LZName, list2[i].LZCode, quoteUrl);
            sb.Append("</tr>");
        }
        sb.Append("</table>");
        sb.Append("</div>");
        #endregion
        //}
        //catch
        //{
        //    sb = new StringBuilder();
        //}
        return sb;
    }

    private StringBuilder sb操盘必备()
    {
        StringBuilder sb = new StringBuilder();
        //try
        //{
        string url = jsonUrl + "comm/module.ashx?id=cpbb";
        string str = Pub.LoadData(url);
        List<List<NewsSBEnty>> obj = JsonConvert.DeserializeObject<List<List<NewsSBEnty>>>(str);
        foreach (var item in obj)
        {
            for (int i = 0; i < item.Count; i++)
            {
                sb.AppendFormat("<a href=\"{1}\"><span style=\"{2}{3}\">{0}</span></a> ", item[i].Text, item[i].Url, string.IsNullOrEmpty(item[i].Color) ? "" : "color:" + item[i].Color + ";", string.IsNullOrEmpty(item[i].FontWeight) ? "" : "font-weight:" + item[i].FontWeight + ";");
            }
            sb.AppendFormat("<br />");
        }
        //}
        //catch { }
        return sb;
    }

    private StringBuilder sb热门板块股票()
    {
        StringBuilder sb = new StringBuilder();
        //try
        //{
        string url = jsonUrl + "comm/module.ashx?id=rmbk";
        string str = Pub.LoadData(url);
        List<List<NewsSBEnty>> obj = JsonConvert.DeserializeObject<List<List<NewsSBEnty>>>(str);
        foreach (var item in obj)
        {
            for (int i = 0; i < item.Count; i++)
            {
                sb.AppendFormat("<a href=\"{1}\" class=\"w\">{0}</a> ", item[i].Text, item[i].Url);
            }
            sb.AppendFormat("<br />");
        }
        //}
        //catch { }
        return sb;
    }

    private StringBuilder sb名师解盘()
    {
        StringBuilder sb = new StringBuilder();
        //try
        //{
        string str = Pub.LoadData(jsonUrl + "news/msjp.ashx");
        List<MSJPEnty> list = JsonConvert.DeserializeObject<List<MSJPEnty>>(str);
        int i = 0;
        foreach (var m in list)
        {
            i++;
            sb.AppendFormat("<li><a href=\"{1}\"><img src=\"http://down3.emstock.com.cn/www/images/ms/{2}.jpg\" alt=\"上海著名证券分析师\" vspace=\"3\" align=\"left\" border=\"0\" class=\"img\" /></a><span class=\"font14 blue\">{0}：</span>", m.name, m.lst[0].Url, i);
            if (m.lst.Count > 0)
            {
                sb.AppendFormat("<a href=\"{0}\" target=\"_blank\">{1} ({2})</a>", m.lst[0].Url, m.lst[0].Title, OTO.ToDate(m.lst[0].PTime, DateTime.Now).ToString("yyyy-MM-dd"));
            }
            sb.AppendFormat("</li>");
            sb.AppendFormat("<div class=\"clearok\"></div>");
        }
        //}
        //catch { }
        return sb;
    }

    private StringBuilder sb益盟视点()
    {
        StringBuilder sb = new StringBuilder();
        //try
        //{
        string str = Pub.LoadData(jsonUrl + "topic/TopicList.ashx");
        List<ZtListEnty> list = JsonConvert.DeserializeObject<List<ZtListEnty>>(str);
        if (list.Count > 0)
        {
            sb.AppendFormat("<table width=\"100%\" border=\"0\" cellspacing=\"0\" cellpadding=\"3\"  bgcolor=\"#999999\"><tr>");
            sb.AppendFormat("<td bgcolor=\"#FFFFFF\"><img src=\"http://stock.emoney.cn/topic/images/topics/face/{0}\" align=\"left\" class=\"img\" /></td>", list[0].ImageUrl);
            sb.AppendFormat("<td bgcolor=\"#FFFFFF\"><a href=\"{2}topic/topic_{1}.shtml\" title=\"{0}\" class=\"font-weight b\">{0}</a>", OTO.CutStr(list[0].Title, 8), list[0].Id, "http://stock.emoney.cn/");
            sb.AppendFormat("<br />{0}</td>", OTO.CutStr(list[0].Summary, 25));
            sb.AppendFormat("</tr></table>");
            //int len = 4;
            //if (list.Count < len)
            //    len = list.Count;
            //sb.AppendLine("<ul>");
            //for (int i = 1; i < len; i++)
            //{
            //    sb.AppendFormat("<li> ·<a href=\"{2}topic/topic_{1}.shtml\" >{0}</a></li>", list[i].Title, list[i].Id, NewsUrl);
            //}
            //sb.AppendLine("</ul>");
            sb.Append("<div style=\"width:100%;text-align:center;\"><a href=\"http://18.emoney.cn\"><img src=\"http://down3.emstock.com.cn/www/images/gsttxs_110707.jpg\" alt=\"\" style=\"width:220px; height:50px;border:0px;\"></a></div>");
        }
        //}
        //catch { }
        return sb;
    }

    private StringBuilder sb天气预报()
    {
        StringBuilder sb = new StringBuilder();
        //try
        //{
        string str = Pub.LoadData(jsonUrl + "comm/weather.ashx");
        WeatherEnty obj = new WeatherEnty();
        if (!String.IsNullOrEmpty(str))
            obj = JsonConvert.DeserializeObject<WeatherEnty>(str);
        if (obj != null)
        {
            //sb.AppendFormat("<img src=\"http://down3.emstock.com.cn/www/images/weather/w{0}.png\" width=\"63\" class=\"index_forecast_ico\" />", obj.weather);
            sb.AppendFormat("<div style=\"background:url(http://down3.emstock.com.cn/www/images/weather/w{0}.png) no-repeat;_filter:progid:DXImageTransform.Microsoft.AlphaImageLoader(src='http://down3.emstock.com.cn/www/images/weather/w{0}.png', sizingMethod='crop');_background:none; width:63px; height:63px;position:absolute; left:48px; top:-15px;\">&nbsp;</div>", obj.weather);
            sb.AppendFormat("<div id=\"showWeatherText\" class=\"index_forecast_text\">{1}<br/>{0}</div>", obj.content, GetWather(OTO.ToInt(obj.weather, 0)));

            sb.AppendLine("<div class=\"bd hide\" id=\"sweather\">");
            //sb.AppendFormat("<div class=\"tianqi fl\"><img src=\"http://down3.emstock.com.cn/www/images/weather/w{0}.png\" width=\"63\"/>", obj.weather);
            //sb.AppendFormat("<div class=\"tianqi_txt\">{0}</div></div>", GetWather(OTO.ToInt(obj.weather, 0)));
            //sb.AppendFormat("<div class=\"fl tianqi_right ml10\">{0}</div>", obj.content);
            //sb.AppendLine("<div class=\"clr\"></div>");
            sb.AppendLine("<div class=\"mt6\">");
            sb.AppendLine("<div class=\"tq_ml\"><img src=\"http://down3.emstock.com.cn/www/images/left12_06.jpg\" /><br>");
            sb.AppendFormat("<span class=\"ml5 mt6 fw\">{0}%</span></div>", obj.posi);
            sb.AppendFormat("<div class=\"tq_qs\"><span class=\"gray\">短期策略</span>：{0}<br>", obj.short_strategy);
            sb.AppendFormat("<span class=\"gray\">中期策略</span>：{0}</div>", obj.long_strategy);
            sb.AppendLine("<div class=\"clr\"></div>");
            sb.AppendLine("</div>");

            QsRsEnty obj2 = JsonConvert.DeserializeObject<QsRsEnty>(Pub.LoadData(jsonUrl + "hangqing/bkqr.ashx"));
            if (obj != null)
            {
                sb.AppendLine("强势板块：");
                foreach (var m in obj2.qsbk)
                {
                    sb.AppendFormat("  <a href=\"{2}bk{0}.shtml\" class=\"b\">{1}</a> ", m.stockid, m.name, quoteUrl);
                }

                sb.AppendLine("<br />弱势板块：");
                foreach (var m in obj2.rsbk)
                {
                    sb.AppendFormat("  <a href=\"{2}bk{0}.shtml\" class=\"b\">{1}</a> ", m.stockid, m.name, quoteUrl);
                }
            }

            sb.AppendLine("<div class=\"clr\">&nbsp;&nbsp;</div>");
            sb.AppendLine("</div>");
        }
        else
        {
            sb.AppendFormat("<div style=\"background:url(http://down3.emstock.com.cn/www/images/weather/w1.png) no-repeat;_filter:progid:DXImageTransform.Microsoft.AlphaImageLoader(src='http://down3.emstock.com.cn/www/images/weather/w1.png', sizingMethod='crop');_background:none; width:63px; height:63px;position:absolute; left:48px; top:-15px;\">&nbsp;</div>", obj.weather);
            sb.AppendLine("<div class=\"index_forecast_text\">严格控制仓位，等待严格控制仓位，等待时机...</div>");
        }
        //}
        //catch { }
        return sb;
    }

    protected string GetWather(int v)
    {
        string rel = "";
        switch (v)
        {
            case 1:
                rel = "艳阳高照";
                break;
            case 2:
                rel = "阳光普照";
                break;
            case 3:
                rel = "中雨";
                break;
            case 4:
                rel = "雷阵雨";
                break;
            case 5:
                rel = "多云转晴";
                break;
            case 6:
                rel = "多云";
                break;
            case 7:
                rel = "多云";
                break;
            case 8:
                rel = "小雨";
                break;
            case 9:
                rel = "冬日暖阳";
                break;
            case 10:
                rel = "多云";
                break;
            case 11:
                rel = "冬日暖阳";
                break;
            case 12:
                rel = "小雪";
                break;
            case 13:
                rel = "冬日暖阳";
                break;
            case 14:
                rel = "晴转多云";
                break;
            case 15:
                rel = "阴雨绵绵";
                break;
            case 16:
                rel = "漫天飞雪";
                break;
            case 17:
                rel = "雷阵雨";
                break;
            case 18:
                rel = "倾盆大雨";
                break;
        }
        return rel;
    }

    protected StringBuilder sb股票医生评分榜()
    {
        StringBuilder sb = new StringBuilder();
        //try
        //{
        string url = jsonUrl + "stock/StockDoctorList.ashx?top=6";
        List<DoctorGradeEnty> list = JsonConvert.DeserializeObject<List<DoctorGradeEnty>>(Pub.LoadData(url));

        #region
        sb.Append("<table width=\"99%\" border=\"0\" cellpadding=\"0\" cellspacing=\"1\">");
        sb.Append("<tr align=\"center\">");
        sb.Append("<td height=\"22\">个股名称</td>");
        sb.Append("<td >成交</td>");
        sb.Append("<td >涨跌幅</td>");
        sb.Append("<td >评分</td>");
        sb.Append("</tr>");
        for (int i = 0; i < list.Count; i++)
        {
            string _class = "";
            if (i % 2 == 0)
                _class = "class=\"bgGray\"";
            sb.AppendFormat("<tr align=\"center\" {0}>", _class);
            sb.AppendFormat("<td height=\"22\"><a href=\"{2}gg{1}.shtml\">{0}</a></td>", list[i].N, list[i].StockId, quoteUrl);
            sb.AppendFormat("<td >{0}</td>", OTO.ToDecLine(list[i].P, 2, "-"));
            sb.AppendFormat("<td > {0}</td>", OTO.PerRedGre(list[i].F, 2, "-", "%"));
            sb.AppendFormat("<td >{0}</td>", OTO.ToDecLine(list[i].TotalScore, 0, "-"));
            sb.Append("</tr>");
        }
        sb.Append("</table>");
        #endregion
        //}
        //catch
        //{
        //    sb = new StringBuilder();
        //}
        return sb;
    }

    protected StringBuilder sb每日一股()
    {
        StringBuilder sb = new StringBuilder();
        //try
        //{
        string url = jsonUrl + "news/NewsListMany.ashx?typeid=0111&top=1";
        string str = Pub.LoadData(url);
        List<NewsList> list = JsonConvert.DeserializeObject<List<NewsList>>(str);
        sb.AppendLine("<ul class=\"yigu\">");
        foreach (var item in list)
        {
            if (item.list.Length > 0)
            {
                sb.AppendFormat("<li class=\"h2\"><a href=\"{1}\">{0}</a></li>", item.list[0].Title, GetNewsUrl("10", item.typeid, item.list[0].Id));
                str = Pub.LoadData(jsonUrl + "/news/UNews.ashx?id=" + item.list[0].Id);
                NewsContentEnty obj = JsonConvert.DeserializeObject<NewsContentEnty>(str);
                if (obj != null)
                {
                    sb.AppendFormat("<li class=\"font12 gray shuojin\">{0}<span class=\"lan\"><a href=\"{1}\">[先睹为\"赚\"详情请进]</a></span></li>", obj.Summary, GetNewsUrl("10", item.typeid, obj.Id));
                }
            }
        }
        sb.AppendLine("<li class=\"mt12\"><span class=\"blue\">操作思路马上知:</span><span class=\"tell\">400-670-7799</span><input name=\"\" style=\"padding:0px;margin:0px;\" type=\"button\" value=\"在线咨询\" class=\"zhidao\" onclick=\"window.open('http://chat10.live800.com/live800/chatClient/chatbox.jsp?jid=3968645766&companyID=87735&configID=163194&skillId=8757&enterurl=http%3A%2F%2Fchat10%2Elive800%2Ecom%3A8080%2Flive800%2Fpreview%2Ejsp&tm=1299136645122')\"/></li>");
        sb.AppendLine("</ul>");
        //}
        //catch { }
        return sb;
    }

    protected StringBuilder sb资料下载()
    {
        StringBuilder sb = new StringBuilder();
        //try
        //{
        string url = jsonUrl + "news/xxzlxz.ashx";
        string str = Pub.LoadData(url);
        List<NewsListEnty> list = JsonConvert.DeserializeObject<List<NewsListEnty>>(str);
        foreach (var item in list)
        {
            sb.Append("<div class=\"index_gsyj2_m_1_3\">");
            sb.Append("  <div class=\"index_content_h h3 blue\"><img src=\"http://down3.emstock.com.cn/www/images/index_ico2.gif\" class=\"img\" />学习资料下载<span class=\"index_content_h_more\"><a href=\"http://bbs.emoney.cn/forum-13706-1.html\" class=\"b\">更多>></a></span></div>");
            sb.Append("  <div class=\"index_gszb2_l_1a\">");
            sb.Append("    <ul>");
            for (int i = 0; i < list.Count; i++)
            {
                sb.AppendFormat("<li> ·<a href=\"{1}\" class=\"b\" target=\"_blank\">{0}</a> </li>", OTO.CutStr(list[i].Title, 22), list[i].Url);
            }
            sb.Append("    </ul>");
            sb.Append("  </div>");
            sb.Append("</div>");
            break;
        }
        //}
        //catch
        //{ }
        return sb;
    }

    protected StringBuilder sb市场焦点()
    {
        StringBuilder sb = new StringBuilder();
        //try
        //{
        string url = jsonUrl + "comm/scjd.ashx";
        string str = Pub.LoadData(url);
        Topics obj = JsonConvert.DeserializeObject<Topics>(str);

        if (obj != null)
        {
            sb.AppendLine("<ul>");
            sb.AppendFormat("<li><img src=\"{2}\" width=\"95\" height=\"79\" vspace=\"5\" align=\"left\" class=\"img\" /><span class=\"paddingLeft5\"><a href=\"{1}\" class=\"font-weight b h3\">{0}</a></span><br />", obj.News.Title, obj.News.Url, obj.News.ImgUrl);
            sb.AppendFormat("<span class=\"paddingLeft5 gray\">{0} <a href=\"{1}\" class=\"b\">[详细]</a></span></li>", OTO.CutStr(obj.News.Content, 25), obj.News.Url);
            sb.AppendLine("<div class=\"clearok\"></div>");
            sb.AppendLine("<li class=\"ling_h18\" style=\"padding-left:10px;\"><span class=\"font-weight\">涉及个股</span>　");
            foreach (var m in obj.Stocks)
            {
                sb.AppendFormat("<a href=\"{2}gg{1}.shtml\" class=\"b\">{0}</a>　", m.StockName, m.Stock, quoteUrl);
            }
            sb.AppendLine("</li>");
            sb.AppendLine("</ul>");
        }
        //}
        //catch { }
        return sb;
    }

    protected StringBuilder sb市场焦点列表()
    {
        StringBuilder sb = new StringBuilder();
        //try
        //{
        string url = jsonUrl + "comm/scjdLst.ashx";
        string str = Pub.LoadData(url);
        List<jdlistEnty> list = JsonConvert.DeserializeObject<List<jdlistEnty>>(str);
        sb.AppendLine("<ul>");
        for (int i = 1; i < list.Count; i++)
        {
            sb.AppendFormat("<li><img src=\"{0}\" width=\"95\" height=\"79\" /><br />", list[i].ImgUrl);
            sb.AppendFormat("<a href=\"{1}\" class=\"b\">{0}</a></li>", list[i].Title, list[i].id);
        }
        sb.AppendLine("</ul>");
        //}
        //catch
        //{
        //    sb = new StringBuilder();
        //}
        return sb;
    }

    protected StringBuilder sb买卖提示()
    {
        StringBuilder sb = new StringBuilder();
        //try
        //{
        string url = jsonUrl + "hangqing/BSCount.ashx";
        string str = Pub.LoadData(url);
        BSEnty obj = JsonConvert.DeserializeObject<BSEnty>(str);
        if (obj != null)
        {
            sb.AppendFormat("当前B点买入信号股票：<br /><span class=\"blue\">{0}支</span><br />", obj.B);
            sb.AppendFormat("当前S点卖出信号股票：<br /><span class=\"blue\">{0}支</span>", obj.S);
        }
        //}
        //catch
        //{
        //    sb = new StringBuilder();
        //}
        return sb;
    }

    protected StringBuilder sb视频()
    {
        StringBuilder sb = new StringBuilder();
        //try
        //{
        VideoBiz biz = new VideoBiz();
        List<VideoEnty> list = biz.GetVideoList(3);
        for (int i = 0; i < list.Count; i++)
        {
            if (i == 0)
            {
                NewsContentEnty obj = JsonConvert.DeserializeObject<NewsContentEnty>(Pub.LoadData(jsonUrl + "/news/UNews.ashx?id=47303"));
                if (obj != null)
                {
                    sb.AppendLine("<table width=\"100%\" border=\"0\" cellspacing=\"0\" cellpadding=\"0\">");
                    sb.AppendLine("<tr>");
                    sb.AppendFormat("<td width=\"140\"><a href=\"{1}videoroom.aspx?id={0}\"><img src=\"{2}\" width=\"135\" height=\"95\" border=\"0\" /></a></td>", list[0].v_id, serviceUrl, obj.ImageUrl);
                    sb.AppendFormat("<td valign=\"top\"><a href=\"{3}videoroom.aspx?id={2}\">{0}</a><br />{1}</td>", obj.Title, OTO.CutStr(obj.Summary, 40), list[0].v_id, serviceUrl);
                    sb.AppendLine("</tr>");
                    sb.AppendLine("</table>");
                }
            }
            if (i == 0)
                sb.AppendLine("<div style=\"padding:10px;\">");

            sb.AppendFormat("<span style=\"line-height:18px;\"><img src=\"http://down3.emstock.com.cn/www/images/index_ico4.png\"/> <a href=\"{2}videoroom.aspx?id={1}\">{0}</a></span>&nbsp;&nbsp;&nbsp;&nbsp;", OTO.CutStr(list[i].v_title, 18), list[i].v_id, serviceUrl);


        }
        if (list.Count > 1)
            sb.AppendLine("</div>");

        sb.Append("<div class=\"clearok\">&nbsp;&nbsp;</div>");

        //}
        //catch
        //{
        //    sb = new StringBuilder();
        //}
        return sb;
    }


    protected StringBuilder sb友情链接()
    {
        StringBuilder sb = new StringBuilder();
        //try
        //{
        string url = jsonUrl + "news/NewsListMany.ashx?typeid=1102&top=21";
        string str = Pub.LoadData(url);
        List<NewsList> list = JsonConvert.DeserializeObject<List<NewsList>>(str);
        foreach (var item in list)
        {
            #region
            switch (item.typeid)
            {
                case "1102":
                    {
                        sb.Append("<ul>");
                        foreach (var m in item.list)
                        {
                            sb.AppendFormat("<li><a href=\"{1}\" title=\"{0}\">{0}</a></li>", m.Title, m.Url);
                        }
                        sb.Append("</ul>");
                        break;
                    }
            }
            #endregion
        }
        //}
        //catch
        //{ }
        return sb;
    }

}